<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0,
		minimum-scale=1.0, maximum-scale=1.0"/>
    <meta charset="UTF-8">
    <title>订货单</title>
    <link href="../public/css/style.css" rel="stylesheet">
    <link href="../public/css/common.css" rel="stylesheet">
    <script type="text/javascript" src="../public/js/jquery.js" ></script>
    <script type="text/javascript" src="../public/js/product.js" ></script>
</head>
<body class="layout_body">
<div class="layout_content graybg">
    <header class="demo-header" style="padding-top: 10px;">
        <div class="titleLeft flt">
            <a href="/ucenter/welcome/">
                <img src="../public/img/back.png" width="35px" height="33px">
            </a>
        </div>
        <div class="titleRight flt text-center">订货单</div>
    </header>
    <div class="have-order">
        <div class="return-sousuo"><input type="text" placeholder="搜索"/></div>
        <?php if (isset($OrderList)){ ?>
            <?php foreach ($OrderList as $key => $order){ ?>
                <div class="whitebg">
                    <div class="sizecolor flt" onclick="detail(<?php echo $order['id'];?>)">订单号：<?php echo $order['ordercode']; ?></div><div class="frt zonge" style=""><?php echo $order['status_string'];  ?></div>
                    <div class="clear_both"></div>
                    <div class="message-detail" onclick="detail(<?php echo $order['id'];?>)">
                        <p>客户名称：<?php echo $order['contact']; ?></p>
                        <p>支付状态：<?php echo $order['pay_status_string']; ?></p>
                        <p>物流状态：<?php echo $order['delivery_status_string']; ?></p>
                        <p>下单时间：<?php echo $order['insert_time']; ?></p>
                    </div>

                    <div class="padding-adjust4 border1">
                        <div class="order-money">订单金额:<span class="product money-color"><strong>￥<?php echo $order['price']; ?></strong></span></div>
                        <?php if (!empty($order['actionList'])){ ?>
                            <?php foreach ($order['actionList'] as $k => $v) { ?>
                                <a>
                                    <div order_id = <?php echo $order['id']; ?> class="button-two
                                            <?php if ($v['action'] == 'promptlypay'){
                                                        echo 'Corange '.$v['action'];
                                                  }else{
                                                        echo 'Cgray '.$v['action'];
                                                 } ?> > "
                                        <?php if ($v['action'] == 'promptlypay') echo 'style="border: 1px solid #EF5507;"'; ?> >

                                        <?php echo $v['title']; ?>
                                    </div>
                                </a>
                            <?php } ?>
                        <?php } ?>
                    </div>

                </div>
            <?php } ?>
        <?php }else{ ?>
            <div style="display: none;" class="no-order">
                <div class="cart-no"><img src="../public/img/null_order.png"/></div>
                <div class="fontC text-center">还没有订单<span style="vertical-align: sub;">~</span></div>
                <a href="index.html"><div class="gobuy">去下单</div></a>
            </div>
        <?php } ?>
        <div id="tip" class="tip"></div>
    </div>
</div>
</body>
    <script type="text/javascript" src="../public/js/layer/layer.js"></script>

<script>
    $('body').on('click','.cancel',function (el) {
        var order_id = parseInt($(this).attr('order_id'));
        var index = layer.msg('取消中', {icon: 16,shade: 0.01,time:1000000});
        $.ajax({
            url: '/ajax/orderfrom/',
            type: 'post',
            dataType: 'json',
            data: {'ajaxdata': 'cancel','order_id':order_id},
            success: function (response) {
                layer.msg(response.msg);
                layer.close(index);
                window.location.reload();
            },
            beforeSend: function () {
            }
        });
    });
    function detail($order_id) {
        window.location.href ='/orderfrom/detail?order_id='+$order_id;
    }
</script>
</html>
